package shiyan2;

class Dog extends Animal implements Trainable, Swimmable {
    private String breed;

    // 构造方法
    public Dog(String name, int age, String breed) {
        super(name, age);
        this.breed = breed;
    }

    // 获取品种的方法
    public String getBreed() {
        return breed;
    }

    // 实现 makeSound 方法
    @Override
    public void makeSound() {
        System.out.println("Woof!");
    }

    // 实现 train 方法
    @Override
    public void train() {
        System.out.println(this.getName() + " is being trained.");
    }

    // 实现 swim 方法
    @Override
    public void swim() {
        System.out.println(this.getName() + " is swimming.");
    }
}